package joodle.ui;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;

import joodle.domain.Canvas;
import joodle.si.ResourceManager;
/**
 * Represent the "Delete" action on the menu bar
 *
 */
@SuppressWarnings("serial")
public class DeleteAction extends AbstractAction {

	public DeleteAction() {
		putValue(Action.SMALL_ICON, ResourceManager.makeIcon("delete"));
		putValue(Action.SHORT_DESCRIPTION, "Delete");
	}
	/**
	 * @see AbstractAction#actionPerformed(ActionEvent)
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
		Canvas.instance().deleteSelectedShapes();
		CanvasComponent.instance().repaint();
	}

}
